﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace TopVisionVideoStream.Models
{
    public class CompanyMemberInfo
    {
        /// <summary>
        /// 设备号
        /// </summary>
        public string zwannumber { get; set; }
        /// <summary>
        /// ID
        /// </summary>
        public string zwanid { get; set; }
        /// <summary>
        /// 
        /// </summary>
        public string phonenumber { get; set; }
        /// <summary>
        /// 在线状态
        /// </summary>
        public string status { get; set; }
        /// <summary>
        /// 设备类型
        /// </summary>
        public string type { get; set; }
        /// <summary>
        /// 姓名
        /// </summary>
        public string realname { get; set; }
        /// <summary>
        /// 平台
        /// </summary>
        public int platform { get; set; }

        public string Describe
        {
            //get { return string.Format("{0}({1})", zwannumber, status == "0" ? "离线" : status == "1" ? "在线" : status == "2" ? "通话中" : "未知"); }
            get { return string.Format("{0}", zwannumber); }
        }

        /// <summary>
        /// Returns a hash code for this instance.
        /// </summary>
        /// <returns>
        /// A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table. 
        /// </returns>
        public override int GetHashCode()
        {
            return this.zwannumber.GetHashCode();
        }

        /// <summary>
        /// Determines whether the specified <see cref="System.Object" />, is equal to this instance.
        /// </summary>
        /// <param name="obj">The <see cref="System.Object" /> to compare with this instance.</param>
        /// <returns>
        ///   <c>true</c> if the specified <see cref="System.Object" /> is equal to this instance; otherwise, <c>false</c>.
        /// </returns>
        public override bool Equals(object obj)
        {
            CompanyMemberInfo cmi = obj as CompanyMemberInfo;

            if (cmi == null) return false;

            return this.zwannumber == cmi.zwannumber;
        }
    }
}
